using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu]
public class WorldsColoursList : ScriptableObject
{
	[SerializeField]
	private List<WorldColoursPalette> worldColours = new List<WorldColoursPalette>();

	public WorldColoursPalette GetPalette(int worldId)
	{
		if (worldColours.Count == 0)
		{
			WorldColoursPalette worldColoursPalette = ScriptableObject.CreateInstance<WorldColoursPalette>();
			worldColoursPalette.worldId = worldId;
			return worldColoursPalette;
		}
		WorldColoursPalette worldColoursPalette2 = worldColours.Find((WorldColoursPalette x) => x.worldId == worldId);
		if (worldColoursPalette2 == null)
		{
			return worldColours[0];
		}
		return worldColoursPalette2;
	}
}
